home *** CD-ROM | disk | FTP | other *** search
- Path: asmobj.larc.nasa.gov!jaapjl
- From: jaapjl@asmobj.larc.nasa.gov (Lee Jaap)
- Newsgroups: comp.lang.c
- Subject: Re: HELP! File Pointers
- Date: 25 Jan 1996 20:09:36 GMT
- Organization: probably not speaking for AS&M Inc
- Message-ID: <JAAPJL.96Jan25150936@asmobj.larc.nasa.gov>
- References: <4csr4c$fem@newsbf02.news.aol.com> <1996Jan9.083549.27165@zcon.com>
- Reply-To: J Lee Jaap <jaapjl@asmsun.larc.nasa.gov>
- NNTP-Posting-Host: asmobj.larc.nasa.gov
- In-reply-to: szh@zcon.com's message of Tue, 9 Jan 1996 08:35:49 GMT
-
- In article <1996Jan9.083549.27165@zcon.com> szh@zcon.com (Syed Zaeem Hosain) writes:
- |>In article <4csr4c$fem@newsbf02.news.aol.com>, roberino@aol.com (Roberino) writes:
- |>>
- |>>Here are the steps I am performing:
- |>>
- |>>void main()
- |>
- [...]
- |>> fgets(Line, File2); <----- As soon as this occurs, File1 gets
- |>> wiped out. Why?
- [...]
-
- [Good advice about incorrect call of fgets deleted.]
-
- |>I'd also suggect finding a better compiler - one that properly warns
- |>you about this error in the call.
-
- Of course, you probably won't get any errors unless you include
- the header file that contains the prototype for fgets.
-
- REMEMBER THE HEADER FILES! Otherwise, the compiler takes your usage
- as a declaration. In your case, the compiler guessed that fgets is
- int fgets (char *, FILE *);
- which is not what the standard i/o library expects.
-
- For example,
-
- #include <stdio.h>
-
- RTFM is always good advice.
- --
- J Lee Jaap <JaapJL@ASMSun.LaRC.NASA.Gov> +1 804/865-7093
- employed by, not necessarily speaking for,
- AS&M Inc, Hampton VA 23666-1340
-